package educationaladministrationsystem.CSM.Controller.StudentAndTeacher.Student;

import educationaladministrationsystem.Class.Student;
import educationaladministrationsystem.Result.Result;
import educationaladministrationsystem.CSM.Mapper.Service.StudentAndTeacher.Student.StudentStudentPersonDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//信息查询
@RequestMapping("Student/PersonData")
@RestController
public class StudentPersonDataController {

    @Autowired
    private StudentStudentPersonDataService studentPersonDataService;

    @GetMapping("/Information")
    public Result getInformation(@RequestParam Integer id) {
        Student student = studentPersonDataService.getInformation(id);
        return Result.success(student);
    }

    @GetMapping("/getFacultiesNameByFacultiesId")
    public Result getFacultiesNameByFacultiesId(@RequestParam String id) {
        return Result.success(studentPersonDataService.getFacultiesNameByFacultiesId(id));
    }

    @GetMapping("/getProfessionNameByProfessionId")
    public Result getProfessionNameByProfessionId(@RequestParam String id) {
        return Result.success(studentPersonDataService.getProfessionNameByProfessionId(id));
    }
}
